package cn.etynit.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum  GlobalExceptionCodeEnum {

    // 1.公共成功与失败异常
    OK("成功！","1"),
    ERROR("失败！","-1"),
    FALLBACK("服务不可用！", "-2"),

    // 2.所有微服务的公共错误码，错误码以1XXX开头
    COMMON_PARAM_IS_NULL_ERROR("参数为空异常！","1001"),
    COMMON_PARAM_ILLEGAL_ERROR("非法参数异常！","1002"),
    COMMON_PARAM_JSR303_ERROR("JSR303校验异常！","1003"),

    // 3.user服务异常以3XXX打头
    USER_SMS_CODE_EXPIRED_ERROR("短信验证码已过期！","3001"),
    USER_SMS_CODE_ERROR("短信验证码错误！","3002"),
    USER_PHONE_EXISTS_ERROR("手机号已注册！","3003"),
    USER_REGISTER_ERROR("注册失败，请重试！","3004"),


    // 5.common服务异常以5XXX打头
    COMM_PHONE_IS_NULL_ERROR("手机号不能为空！","5001"),
    COMM_PHONE_FORMAT_ERROR("手机号格式不正确！","5002"),
    COMM_IMAGECODE_IS_NULL_ERROR("图像验证码不能为空！","5003"),
//    COMM_IMAGECODE_FORMAT_ERROR("图形验证码不正确！","5004"),
    COMM_INTERVAL_ERROR("短信发送过于频繁，请稍后重试！","5004");


    private String message;
    private String code;



}
